#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))

require "#{LKP_SRC}/lib/log"

while (line = $stdin.gets)
  case line.chomp!
  when /^(.*): +(\d+) kB$/,
       /^(.*): +(\d+) KiB$/,
       /^(.*): +(\d+)$/
    puts "#{$1}: #{$2}"
  else
    log_error "malformed meminfo line: #{line}"
  end
end
